<extend name="Base/common"/>
<block name="style">
    <style type="text/css">
       .login-logo{
          width:50%;
        
          height:150px; 
       }

       .tips{
        position:fixed;
        background: rgba(0,133,208,0.5);
        width:100%;
        color:#fff;
        font-size:16px;
        text-align: left;
        text-indent: 2em;
        line-height:30px;
        z-index: 99;
        display: none;
    }
    img{
        display: block;
        margin:auto;

        height: 130px;
        border-radius: 5px 5px;


    }
       
        
        /*.weui-cell_access .weui-cell__ftnone:after{border-style:none;}*/
    </style>
</block>
<block name="body">
    <p class="tips"></p>
    <div class="content">
        <div class="login-logo"><img src="__IMG__/ali.png" /></div>
        <form class="formtijiao" action="" method="post">
            <div class="login-register mg-t-8 clearfix">
                
                    <ul class="register-kk">

                        <li><em>账号</em>
                            <input type="text" name="account"  placeholder="请输入手机账号" class="register-sh account" style="width:145px;" />

                        <li><em>密码</em><input type="password"  placeholder="请输入密码"  name="password" class="register-sh " /></li>
                    </ul>
                   
                    <input type="button"  value="登 录" class="login-btn weui-btn" style="height:35px;"/>  
                    <a href="{:U('yonghu')}" style="float:left;height:25px;line-height:25px;font-size:14px;margin-top:5%;color:#0085d0;">我是新用户</a>   
                    <a href="{:U('forget')}" style="float:right;height:25px;line-height:25px;font-size:14px;margin-top:5%;color:#0085d0;">忘记密码</a>  
                


                 </div>
         </form>


    </div>
</block>
<block name="script">
    
    <script>

        Zepto(function($){
             $('.get_captcha').click(function(){
                var  e = $(this);
                if(e.hasClass('disabled')!=false) return false;
                var mobile = $('.mobile').val();//手机号码
                // popup.alert(mobile);
                e.html('发送中..').addClass('disabled');
                //随机验证码
                var t='';
                for(var i=0;i<6;i++){
                    t+=Math.floor(Math.random()*10);
                }
                
                $.ajax({
                    // async:false,
                    type:'post',
                    url:"{:U('User/sendsms')}",
                    data:{'mobile':mobile,'t':t},
                    dataType:'json',
                    success:function(m){
                        alert(m)
                    }
                });

            });
        }) ;

        $('.login-btn').click(function(){

            var data=$('.formtijiao').serializeArray();
            $.ajax({
                type:'post',
                data:data,
                url:"{:U('login')}",
                success:function(m){
                    if(m>0){
                        location.href="{:U('index')}"
                    }else if(m==0){
                        $('.tips').html('该账号不存在')
                        $('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
                    }else{
                        $('.tips').html(m)
                        $('.tips').show()
                        setTimeout(function(){
                            $('.tips').hide()
                            
                        },3000)
                    }
                     
                }
            })
        })



    </script>

</block>